<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="/WEB-INF/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <base href="<%= basePath%>">
<title>欢迎登录信息自动收集系统管理平台</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />

<script language="JavaScript" src="js/jquery.js"></script>
<script src="js/cloud.js" type="text/javascript"></script>
<script type="text/javascript" src="js/templatemo-script.js"></script>
<script type="text/javascript" src="<%= basePath%>js/bootstrap.min.js"></script>    

<script type="text/javascript">
$(function(){		

	$(function(){
		findAllAcademy('selectedAcademy');
	})
	/*******联动开始*********/  
	//$("#selectedAcademy").click(function(){
	   // alert("点击事件");
	//	findAllAcademy('selectedAcademy');
		// hideMultiOper();
//	});
	 //异步查找所有学院
	function findAllAcademy(domId){
		$.ajax({
			type:"POST",
			dataType:"JSON",
			url:"<%=basePath%>biz/DataJson_FindAllAcademy.action",
			data:{"query":""},
			success:function(data){
					//$("#"+domId+"").empty();
			        data=JSON.parse(data);
			       // console.log("测试数组123"+data);
					//$("#"+domId+"").empty();
					//$("#"+domId+"").find("option").remove();
					if(null  != data && undefined  !=data){
						for(var i = 0; i < data.length; i++){
							$("#"+domId+"").append("<option value='"+data[i].academyId+"'>"+data[i].academyName+"</option>");
						}
						// $("#"+domId+"").change();	 
					}
			}
		});
	}
	//异步查找已选学院的专业
	function findAllMajor(academyId , seleMajor){
		//console.log("+++++++++++++++"+academyId)
		$.ajax({
			type:"POST",
			dataType:"JSON",
			url:"<%=basePath%>biz/DataJson_FindAllMajorByAcademy.action",
			data:{"query":JSON.stringify({"academyId":academyId})},
			success:function(data){
			//console.log(data)
		        let json = JSON.parse(data)
				$("#"+seleMajor+"").find("option").remove();
				//console.log("测试数组123456"+json);
				if(null  != json && undefined  != json){
					for(var i = 0; i < json.length; i++){
						//console.log("iiiiiiiiiiiiii"+i)
						$("#"+seleMajor+"").append("<option value='"+json[i].majorId+"'>"+json[i].majorName+"</option>");
					}
					$("#"+seleMajor+"").change();
				}
			}
		});
	}
	//异步查找已选专业的班级
	function findAllClass(majorId , seleClass){
	console.log("测试查找班级时的专业id----"+majorId);
		$.ajax({
			type:"POST",
			dataType:"JSON",
			url:"<%=basePath%>biz/DataJson_FindAllClassByMajor.action",
			data:{"query":JSON.stringify({"majorId":majorId})},
			success:function(data){
			        let json=JSON.parse(data)
					$("#"+seleClass+"").find("option").remove();
					if(null  != json && undefined  != json){
						for(var i = 0; i < json.length; i++){
							console.log("iiiiiiiiiiiiii"+i)
							$("#"+seleClass+"").append("<option value='"+json[i].classId+"'>"+json[i].className+"</option>");
						}									
						 $("#"+seleClass+"").change();
						
					}
			}
		});
	}
	//批量操作-已选学院改变事件
	 $("#selectedAcademy").change(function() {  
	    console.log($(this).val());
	    //console.log($(this).text());
	 	findAllMajor($(this).find("option:selected").val(),'selectedMajor');
	 	$("input[name='selectedCheckbox']:checked").each(function(){
	 		var seleAcademyId = $("#selectedAcademy option:selected").val();
	 		var seleAcademyName = $("#selectedAcademy option:selected").text();
	 		$(this).parent().nextAll().children("input[name^='academyId']").val(seleAcademyId);
	 		$(this).parent().nextAll().children("input[name^='academyName']").val(seleAcademyName);
	 		//将批量操作的学院下拉列表添加到当前行的下拉列表
	 		var dom = $(this).parent().nextAll().children("input[name^='academyId']").next();
	 		dom.find("option").remove();
	 		$("#selectedAcademy").find("option").each(function(){
	 			var newOption = "<option value="+$(this).val()+">"+$(this).text()+"</option>";
	 			dom.append(newOption);
	 		});
	 	});
	}); 
	//批量操作-已选专业改变事件
	 $("#selectedMajor").change(function() {  
	 	console.log("++++++++++++++++++++++"+$(this).find("option:selected").val())
	 	findAllClass($(this).find("option:selected").val(),  'selectedClass');
	 	$("input[name='selectedCheckbox']:checked").each(function(){
	 		var seleMajorId = $("#selectedMajor option:selected").val();
	 		var seleMajorName = $("#selectedMajor option:selected").text();
	 		$(this).parent().nextAll().children("input[name^='majorId']").val(seleCabinetCode);
	 		$(this).parent().nextAll().children("input[name^='majorName']").val(seleCabinetName);
	 		var dom = $(this).parent().nextAll().children("input[name^='majorId']").next();
	 		dom.find("option").remove();
	 		$("#selectedMajor").find("option").each(function(){
	 			var newOption = "<option value="+$(this).val()+">"+$(this).text()+"</option>";
	 			dom.append(newOption);
	 		});
	 	});
	}); 
	//批量操作-已选班级改变事件
	 $("#selectedClass").change(function() {
	 console.log("测试已选班级改变事件----"+$(this).find("option:selected").val());
	 	$("input[name='selectedCheckbox']:checked").each(function(){
	 		var seleClassId = $("#selectedClass option:selected").val();
	 		var seleClassName = $("#selectedClass option:selected").text();
	 		$(this).parent().nextAll().children("input[name^='classId']").val(seleClassId);
	 		$(this).parent().nextAll().children("input[name^='className']").val(seleClassName);
	 		//将批量操作的盒子下拉列表添加到当前行的下拉列表
	 		var dom = $(this).parent().nextAll().children("input[name^='classId']").next();
	 		dom.find("option").remove();
	 		$("#selectedClass").find("option").each(function(){
	 			var newOption = "<option value="+$(this).val()+">"+$(this).text()+"</option>";
	 			dom.append(newOption);
	 		});

	 	});
	});
}); 


</script>

<style>  
.black_overlay{  
 display: none;  
 position: absolute;  
 top: 0%;  
 left: 0%;  
 width: 100%;  
 height: 100%;   
 z-index:1001;  
 -moz-opacity: 0.8;  
 opacity:.80;  
 filter: alpha(opacity=80);  
}  
.white_content {  
 display: none;  
 position: absolute;  
 top: 10%;  
 left: 30%;  
 width: 35%;  
 height: 85%;  
 border: 1px solid lightblue;  
 background-color: rgba(0,75,50,0.5);
 z-index:1002;  
 overflow: auto;  
}  
.white_content_small {  
 display: none;  
 position: absolute;  
 top: 0%;  
 left: 50%;  
 width: 50%;  
 height: 50%;  
 border: 1px solid lightblue;    
 z-index:1002;  
 overflow: auto;
}
.mytitle{
 font-weight:bold;
 text-align:center;
 font-size:20px;
 margin-left:50px;
 margin-right:50px;
 color:#ccc;
}
.label{
color:#eee;
}  
</style>
<script language="javascript">
	$(function(){
        $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	$(window).resize(function(){  
          $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
    })  
 });  
    function register(show_div,bg_div){
	     document.getElementById(show_div).style.display='block';  
	     document.getElementById(bg_div).style.display='block' ;  
		 var bgdiv = document.getElementById(bg_div);  
		 bgdiv.style.width = document.body.scrollWidth;   
		 // bgdiv.style.height = $(document).height();  
		 $("#"+bg_div).height($(document).height());  
};  
//关闭弹出层  
function CloseDiv(show_div,bg_div)  
 {  
	 document.getElementById(show_div).style.display='none';  
	 document.getElementById(bg_div).style.display='none';  
  }
</script> 

</head>

<body style="background-color:#1c77ac; background-image:url(images/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">



    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  


<div class="logintop">    
    <span>欢迎登录信息自动收集系统管理平台</span>    
    <ul>
    <li><a href="#">回首页</a></li>
    <li><a href="#">帮助</a></li>
    <li><a href="#">关于</a></li>
    </ul>    
    </div>

  <div class="loginbody">
    
    <span class="systemlogo"></span> 
    
    <div class="loginbox">
      <form action="<%=path%>/front/Login_webLogin.action" method="post">
        <ul>
          <li><input name="sysUser.userId" id="uname" type="text" class="loginpwd" value="root" onclick="JavaScript:this.value=''"/></li>
          <li><input name="sysUser.userPassword" id="upwd" type="password" class="loginpwd" value="123" onclick="JavaScript:this.value=''"/></li>
          <li>
          <input name="" type="submit" class="loginbtn" value="登录" /><!--<label><input name="" type="checkbox" value="" checked="checked" />记住密码</label><label><a href="#">忘记密码？</a></label>-->
         <%--  <a href="<%= basePath%>/front/Register_openRegisteractionWeb.action" type="submit" class="registerbtn" value="注册">注册 </a> --%>
         <!--  <button id="login" class="login" data-toggle="modal" data-target="#loginModal">没有账号？点击注册</button> -->
          <%-- <input name="" type="submit" class="registerbtn" value="注册" /> --%>
              <label><a id="register" data-toggle="modal" data-target="#registModal" onclick="register('MyDiv','fade')">没有账号？点击注册</a> </label>            
          </li>         
        </ul>
      </form>
    
    </div>
    
    </div>
   <div id="fade" class="black_overlay">  
</div>  
 <div id="MyDiv" class="white_content">  
  <div style="text-align: right;  height:0px;">  
   <span style="font-size: 16px;" onclick="CloseDiv('MyDiv','fade')">关闭</span>  
  </div>      
   <div class="formbody"  id="tab1">
  <form action="<%= basePath%>/front/Register_addRegisteractionUser.action" method="post" id="commonform">
    <ul class="forminfo">
    <front class="mytitle">请认真填写您的信息以保证信息的准确性</front>
    <br/>
    <br/>
    <li><label><front class="label">学号</front></label><input name="sysUser.userId" type="text" placeholder="请输入用户编号" class="dfinput" /></li>
    <li><label><front class="label">密码</front></label><input name="sysUser.userPassword" type="text" placeholder="请输入密码" class="dfinput" /></li>
    <li><label><front class="label">姓名</front></label><input name="sysUser.userName" type="text" placeholder="请输入姓名" class="dfinput" /></li>
    <li><label><front class="label">邮箱</front></label><input name="sysUser.userEmail" type="text" placeholder="请输入邮箱" class="dfinput" /></li>
  <!-- <li><label><front class="label">身份证号</front></label><input name="sysUser.userStuID" type="text" placeholder="请输入正确的身份证号码" class="dfinput" /></li> -->  
    <li><label><front class="label">手机号码</front></label><input name="sysUser.userPhone" id="userTelephone" type="text" placeholder="请输入手机号码" class="dfinput"  /><i><font color="#FF0000"></font>11位大陆手机号</i></li>
    
    
	 <li><label><front class="label">学院</front></label><select name="userCollege"id="selectedAcademy" class="scinput">								 
						<option value="">请选择学院 ...</option>					
						</select></li> 
    <li><label><front class="label">专业</front></label><select name="userMajor"id="selectedMajor" class="scinput">										 
						<option value="">请选择专业...</option>					
						</select></li>
	<li><label><front class="label">班级</front></label><select name="userClass"id="selectedClass" class="scinput">										 
						<option value="">请选择班级... </option>					
						</select></li>
   <!-- 
    <li><label><front class="label">科室</front></label><input name="sysUser.userStudio"type="text" placeholder="请输入科室名称" class="dfinput" ></input></li>
    <li><label><front class="label">身份类型</front></label>
				<input name="userType" id="userType" type="radio" value="0"  checked="checked"  />学生
				<input name="userType" id="userType" type="radio" value="1"   />教师
				<input name="userType" id="userType" type="radio" value="9"   />管理员
	<i><font color="#FF0000">*必选</font></i>
	</li> --> 
    <li><label><front class="label">性别</label>
				<input name="userSex" id="userSex" type="radio" value="1"  checked="checked"  />男
				<input name="userSex" id="userSex" type="radio" value="2"   />女
	</li>	
    </ul>
    <ul class="forminfo">
    <li><label>&nbsp;</label><input name="" type="submit" class="btn" value="确认保存"/></li>
    </ul>
    </form>
    
    </div>
    
    
    
    
 </div>  
    <div class="loginbm">技术支持：大创开发团队</div>
    
</body>

</html>
